<?php

namespace App\Http\Requests\Administrator;

class OddsHandicapRequest extends Request
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        switch ($this->method()) {
            // CREATE
            case 'POST':
                {
                    return [
                        'plat_code' => 'required|string',
                        'plat_id' => 'required|exists:def_main_game_plats,id',
                        'code' => 'required|unique:odds_handicaps,code',
                        'odds_value' => 'required|integer',
                        'description' => 'nullable|string',
                    ];
                }
            // UPDATE
            case 'PUT':
            case 'PATCH':
                {
                    return [
                        'plat_code' => 'required|string',
                        'plat_id' => 'required|exists:def_main_game_plats,id',
                        'code' => 'required|string',
                        'odds_value' => 'required|integer',
                        'description' => 'nullable|string',
                    ];
                }
            case 'GET':
            case 'DELETE':
            default:
                {
                    return [];
                }
        }
    }
}
